<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var money = 100;
        var j;
        while (true) {
            var i = prompt("请输入您要的操作:\n1.存钱\n2.取钱\n3.显示余额\n4.退出");
            if (i == 1) {
                j = prompt('请您输入存钱的钱数') - 0;
                money += j;
                alert('成功！');
                alert('您现在的钱数是：' + money);
            }
            if (i == 2) {
                j = prompt('请您输入取钱的钱数') - 0;
                if (money >= j) {
                    money -= j;
                    alert('成功！');
                } else {
                    alert('您的余额不足！');
                }
                alert('您现在的钱数是：' + money);
            }
            if (i == 3) {
                alert('您现在的钱数是：' + money);
            }
            if (i == 4) {
                alert('您正在退出！');
                break;
            }
            if (i != 1 && i != 2 && i != 3 && i != 4) {
                alert('输入有误！');
            }
        }
    </script>
</head>

<body>

</body>

</html>